A three-dimensional video image system includes two types of images: a view image and a depth map. The view image includes information, such as color information, of the image itself. The depth map includes depth information, such as contour information, of the view image. To reduce bandwidth occupied by video transmission during transmission of a three-dimensional video image, coding processing needs to be performed on the video image, including coding processing performed on the view image and the depth map, so as to reduce a data size of the three-dimensional video image.
In the prior art, coding processing of the depth map in the three-dimensional video image system uses an intra-frame prediction method. First, a coder splits a to-be-coded image block into one or more sub-image blocks to obtain an intra-frame prediction mode of a current image block, and obtains prediction data of the current image block according to the intra-frame prediction mode, where the image block and the sub-image blocks that are obtained by splitting the image block are generally and collectively referred to as an image block; the prediction data of the image block is used as reference data for coding and decoding the current image block; and the prediction data is pixel data that comes from a coded or decoded neighboring block, or a fixed value preset by a coding-decoding system, or other prediction data that comes from a neighboring block and is used for coding and decoding the current block. The coder successively performs a difference operation between a pixel value of each pixel in the image block and a pixel value of each corresponding pixel in the prediction data (or data of a reference block generated from the prediction data) to obtain a residual matrix, performs quantization, transformation, and entropy coding on the residual matrix, and sends a bitstream obtained by means of entropy coding to a decoder. The decoder reads a bit stream from the obtained bitstream, obtains a corresponding residual by performing dequantization and inverse coding, obtains the prediction data of the current image block, and adds the residual of the current image block and the pixel value of the prediction data (or the pixel value of the reference block generated from the prediction data) to obtain a pixel value of the current image block.
However, when a size of an image block is relatively large, if the method in the prior art is used to calculate an average pixel value of the image block and an average pixel value of a reference image block, a calculation amount is relatively large, and coding and decoding efficiency is low.